<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:76:"D:\phpstudy_pro\WWW\nmg002\public/../application/admin\view\newss\lists.html";i:1657873827;}*/ ?>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> <?php echo $setting['webname']; ?>- 新闻资讯列表</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="/public/static/favicon.ico"> <link href="/public/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/public/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/public/static/admin/css/animate.css" rel="stylesheet">
    <link href="/public/static/admin/css/style.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-sm-4">
            <h2>资讯管理</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="<?php echo url('Admins/admin'); ?>">主页</a>
                </li>
                <li>
                    <strong>资讯管理</strong>
                </li>
            </ol>
        </div>
        <div class="col-sm-8" style="text-align: right;line-height: 15px;margin-top:25px;">
            <small><i class="fa fa-circle" style="color:#f05151"></i>置顶<br/><i class="fa fa-circle" style="color:#f8ac5a"></i>最新<br/><i class="fa fa-circle" style="color:#28c24d"></i>普通</small>
        </div>
    </div>
    <div class="wrapper wrapper-content animated fadeIn">
        <div class="row">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs" id="table-title">
                        <?php foreach($list as $v): ?>
                            <li id="type<?php echo $v['id']; ?>" data-id="<?php echo $v['id']; ?>"><a data-toggle="tab" href="#tab-<?php echo $v['id']; ?>"  aria-expanded="true"> <?php echo $v['type_name']; ?></a></li>
                        <?php endforeach; ?>
                    </ul>
                    <div class="tab-content">
                        <?php foreach($list as $v): ?>
                        <!--新闻列表开始-->
                        <div id="tab-<?php echo $v['id']; ?>" class="tab-pane">
                            <div class="panel-body">
                                <?php if(array_key_exists('newslist',$v)): ?>
                                暂无数据
                                <?php endif; foreach($v['newslist'] as $vs): ?>
                                <!--行开始-->
                                    <div class="forum-item">
                                        <div class="row">
                                            <!--左边部分-->
                                            <div class="col-sm-10">
                                                <?php if(!empty($vs['cover'])): ?>
                                                <div class="row">
                                                <!--用户头像及名称-->
                                                    <div class="col-sm-2" style="text-align: center">
                                                        <img src="<?php echo $vs['cover']; ?>" style="width:100%;display: block;margin:0 auto"/>
                                                    </div>
                                                    <div class="col-sm-10">
                                                        <!--文章标题-文章操作-->
                                                        <div style="font-size:18px;font-weight:bold"  class="forum-item-title">
                                                            <?php switch($vs['sorttype']): case "1": ?><i class="fa fa-circle" style="color:#f05151"></i><?php break; case "2": ?><i class="fa fa-circle" style="color:#f8ac5a"></i><?php break; case "3": ?><i class="fa fa-circle" style="color:#28c24d"></i><?php break; endswitch; ?>&nbsp;
                                                            <?php echo $vs['title']; ?>&nbsp;&nbsp;<a href="<?php echo url('newss/update'); ?>?id=<?php echo $vs['id']; ?>"><i class="glyphicon glyphicon-pencil" style="color:#24b7e5;font-size:12px;"></i></a>&nbsp;&nbsp;<a class="del" data-id="<?php echo $vs['id']; ?>" data-typeid="<?php echo $v['id']; ?>"><i class="glyphicon glyphicon-trash" style="color:#24b7e5;font-size:12px;"></i></a></div>
                                                        <div><span title="发布时间" style="cursor:pointer"><?php echo $vs['create_time']; ?></span><strong> | </strong><span title="修改时间"  style="cursor:pointer"><?php echo $vs['update_time']; ?></span></div>
                                                        <!--文章描述-->
                                                        <div style=" white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">描述：<?php echo $vs['desc']; ?></div>
                                                        <!--关键词-->
                                                        <div>关键词：<?php foreach($vs['key'] as $vvk=>$vvs): ?><span class="badge badge-primary"><?php echo $vvs; ?></span> <?php endforeach; ?></div>


                                                    </div>
                                                </div>
                                                <?php else: ?>
                                                <div class="row">
                                                    <!--用户头像及名称-->
                                                    <div class="col-sm-12">
                                                        <!--文章标题-文章操作-->
                                                        <div style="font-size:18px;font-weight:bold"  class="forum-item-title">
                                                            <?php switch($vs['sorttype']): case "1": ?><i class="fa fa-circle" style="color:#f05151"></i><?php break; case "2": ?><i class="fa fa-circle" style="color:#f8ac5a"></i><?php break; case "3": ?><i class="fa fa-circle" style="color:#28c24d"></i><?php break; endswitch; ?>&nbsp;
                                                            <?php echo $vs['title']; ?>&nbsp;&nbsp;<a href="<?php echo url('newss/update'); ?>?id=<?php echo $vs['id']; ?>"><i class="glyphicon glyphicon-pencil" style="color:#24b7e5;font-size:12px;"></i></a>&nbsp;&nbsp;<a class="del" data-id="<?php echo $vs['id']; ?>" data-typeid="<?php echo $v['id']; ?>"><i class="glyphicon glyphicon-trash" style="color:#24b7e5;font-size:12px;"></i></a></div>
                                                        <div><span title="发布时间" style="cursor:pointer"><?php echo $vs['create_time']; ?></span><strong> | </strong><span title="修改时间"  style="cursor:pointer"><?php echo $vs['update_time']; ?></span></div>
                                                        <!--文章描述-->
                                                        <div>描述：<?php if(strlen($vs['desc']) > 100): ?><?php echo mb_substr($vs['desc'],0,100,'utf-8'); ?>……<?php else: ?> <?php echo $vs['desc']; endif; ?></div>

                                                        <div></div>
                                                        <!--关键词-->
                                                        <div>关键词：<?php foreach($vs['key'] as $vvk=>$vvs): ?><span class="badge badge-primary"><?php echo $vvs; ?></span> <?php endforeach; ?></div>
                                                    </div>
                                                </div>
                                                <?php endif; ?>
                                            </div>
                                            <!--浏览量-->
                                            <div class="col-sm-1 forum-info">
                                            <span class="views-number">
                                                <?php echo $vs['hits']; ?>
                                            </span>
                                                <div>
                                                    <small>浏览量</small>
                                                </div>
                                            </div>
                                            <!--作者-->
                                            <div class="col-sm-1 forum-info">
                                            <span class="views-number">
                                                <img src="/public/static/admin/uploads/headphoto/<?php echo $vs['photo']; ?>" style="width: 40px;display: block;margin:0 auto;border-radius: 50%;"/>
                                            </span>
                                                <div>
                                                    <small><?php echo $vs['author']; ?></small>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                <!--行结束-->
                                <?php endforeach; ?>
                                <?php echo $v['newslist']->render(); ?>
                            </div>

                        </div>

                        <!-- 新闻列表结束 -->
                        <?php endforeach; ?>
                    </div>
                </div>
            </div>
        </div>
       
    </div>


    <!-- 全局js -->
    <script src="/public/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/public/static/admin/js/bootstrap.min.js?v=3.3.6"></script>



    <!-- 自定义js -->
    <script src="/public/static/admin/js/content.js?v=1.0.0"></script>
    <script src="/public/static/admin/layui/layui.js"></script>
    <script>
        $("#type<?php echo $activeid; ?>").attr("class","active");
        $("#tab-<?php echo $activeid; ?>").attr("class","tab-pane active");
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            //点击提交
            $(".del").click(function(){
                var s = $(this);
                top.layer.msg('你确定要删除？', {
                    time: 20000, //20s后自动关闭
                    shade: 0.8,
                    btn: ['确定', '取消'],
                    btn1:function(){
                        $.post("<?php echo url('Newss/deletes'); ?>",{id:s.attr('data-id'),typeid:s.attr('data-typeid')},function(data){
                            top.layer.closeAll();
                            top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                                if(data.url){
                                    window.location.href = data.url;
                                }
                            });
                        });
                    }
                });

            });
        });
    </script>

    
    

</body>

</html>
